using Microsoft.OpenApi.Models;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddAuthentication().AddJwtBearer();

var app = builder.Build();

builder.Services.AddAuthentication();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();


app.MapPost("/todo2/{id}", async (int id) => { })
    .WithOpenApi(generatedOperation =>
    {
        var parameter = generatedOperation.Parameters[0];
        parameter.Description = "The ID associated with the created Todo";
        return generatedOperation;
    });


app.MapGet("/api/todoitems/{id}", async (int id) =>
    {
        return Results.Ok();
// return Results.NotFound();
    })
    .Produces<LSS>(StatusCodes.Status200OK)
    .Produces(StatusCodes.Status404NotFound);


app.MapPost("/todos/{id}", (int id) => { })
    .Accepts<LSS>("application/xml");



app.Run();


class LSS
{
    public string Name { get; set; }
}